import request from "../utils/request.js"

export function getWebCastPage(params) {
  return request({
    url: '/webCast/page',
    method: 'post',
    data: params
  })
}


export function getWebCastDetail(id) {
  return request({
    url: `/webCast/detail/${id}`,
    method: 'get'
  })
}

//取消收藏
export function cancelCollect(params) {
  return request({
    url: `/webCast/cancelCollect`,
    method: 'put',
    data: params,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}

//收藏课程
export function collect(params) {
  return request({
    url: `/webCast/collect`,
    method: 'put',
    data: params,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}

// 课程评论列表
export function getCommentPage(params) {
  return request({
    url: `/webCast/getCommentPage`,
    method: 'put',
    data: params
  })
}

//报名
export function enroll(id) {
  return request({
    url: `/webCast/enroll/${id}`,
    method: 'put',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}

//参与的课程
export function userEnrollWebCastPage(params) {
  return request({
    url: `/webCast/userEnrollWebCastPage`,
    method: 'post',
    data: params
  })
}

//收藏列表
export function collectPage(params) {
  return request({
    url: `/webCast/collectPage`,
    method: 'post',
    data: params
  })
}

//发布的课程列表
export function myPage(params) {
  return request({
    url: `/webCast/myPage`,
    method: 'post',
    data: params
  })
}

//发布的课程列表
export function getWebCastUrl(params) {
  return request({
    url: `/webCast/getWebCastUrl/` + params,
    method: 'get'
  })
}
